package Controller.DVNet;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

class Router {
    String name;
    Area area;
    Map<String, RouterPort> ports;
    Set<RouterPort> borderPorts;
    boolean isBorder;
    static Area defaultArea;

    public Router(String name, Area area) {
        this.name = name;
        this.area = area;
        ports = new HashMap<>();
        borderPorts = new HashSet<>();
        isBorder = false;
    }

    public RouterPort getRouterPort(String name) {
        RouterPort rp;
        if (ports.containsKey(name)) {
            rp = ports.get(name);
        } else {
            rp = new RouterPort(name, this);
            ports.put(name, rp);
        }
        return rp;
    }


}
